<!-- 表格输出 -->
<#macro output_win_table dataTable>
	<#if dataTable.rows?exists>
    	<span class="page_desc">Page:${dataTable.currentPage}/${dataTable.pageCount} &nbsp;&nbsp;${dataTable.rows?size} resords. Total record:${dataTable.recordCount}</span>
	    <div class="single_grid_window">
	    <#assign index_start = (dataTable.currentPage - 1) * dataTable.pageSize>
	    <table cellspacing="1" cellpadding="3" style="background-color: #000000;" id="${dataTable.id?if_exists}">
	   		<tr style="font-weight: bold;cursor:pointer">
	   			<td onclick="sort_this_table(this)">序号</td>
	   			<#list dataTable.th as th>
	   				<td onclick="sort_this_table(this)" id="${th.id?if_exists}" <#if th.width?exists>width="${th.width}"</#if>>${th.value}</td>
	   			</#list>
	   		</tr>
	   		<#list dataTable.rows as row>
	   			<tr onmousemove="mOvr(this)" onmouseout="mOut(this)" onclick="copy(this,false)">
	   				<td>${row_index + 1}</td>
	   				<#list row as td>
	   					<#assign dm = td.dispMode!"">
	   					<#if dm == "pop" || dm == "hiddendiv">
	   						<#assign divid = "div_${row_index}_${td_index}">
	   					</#if>
	   					<td <#if dm == "pop"> onmouseover="dispTd('${divid}')" onmouseout="hideTd('${divid}')"</#if><#if td.onclick??> onclick=${td.onclick }</#if><#if td.title??> title="${td.title}"</#if>><#if td.linkUrl??><a href="${td.linkUrl}"></#if><#if (dm == "pop") || (dm == "hiddendiv")><div id="${divid}" style="display:none">${td.value}</div></#if>${td.goat ? default (td.value)}<#if td.linkUrl??></a></#if></td>
	   				</#list>
	   			</tr>
	   		</#list>
	   	</table>
   	<@page_index dtable.currentPage dtable.pageCount/>
    </div>
	</#if>
</#macro>
<!-- 方法列表输出 -->
<#macro output_methods methods>
<#list methods as method>
	<#if method == "query">
<input type="button" onclick="operateForm('query');" value="查询" id="but_quer"/>
	<#elseif method == "add">
<input type="button" onclick="addRecord();" value="新增" id="but_inse"/>
	<#elseif method == "update">
<input type="button" onclick="operateForm('update');" value="保存" id="but_upda"/>
	<#elseif method == "delete">
<input type="button" onclick="operateForm('delete');" value="删除" id="but_dele"/>
	</#if>
</#list>
</#macro>
<!-- FORM 数据输出 -->
<#macro output_fields fields>
<#list fields as feleO>
    <#assign fele=feleO.htmlWidget>
	<#assign fht=fele.htmlType>
	<#assign fn=feleO.field.fieldName>
	<#assign notHidden = (fht != "hidden")>
	<#if notHidden>
		<#assign posi = posi + 1>
		<#if (posi % rowNum == 0)><tr></#if>
		<#if fht == "text" || fht == "password">
			<td>${fele.dispText}</td>
			<TD><input type = '${fht}' name="${fn}" size="${fele.size?if_exists}" <#if fele.readonly>value="${fele.value!''}" readonly='readonly'</#if> limit="${fele.limits!''}" msg="${fele.comment!''}"></TD>
		<#elseif fht == "select">
			<td>${fele.dispText}</td>
			<td><SELECT name="${fn}" <#if fele.onchange??>onchange = "${fele.onchange}"</#if>  limit="${fele.limits!''}" msg="${fele.comment ! ''}" <#if fele.readonly??>value="${fele.value!''}" readonly='readonly'</#if>>
				<option value="">未选择</option>
				<#list fele.dispList?keys as key>
					<option value="${key}">${fele.dispList[key]}</option>
				</#list>
			</SELECT></td>
		<#elseif fht == "textarea">
			<td>${fele.dispText}</td><td><textarea name="${fn}" rows="${fele.rows?if_exists}" cols="${fele.cols?if_exists}" limit="${fele.limits!''}" msg="${fele.comment!''}"></textarea></td>
		<#elseif fht == "fckeditor">
			<#if (posi%rowNum == 0)><td></td></tr><tr></#if>
			<#if (posi%rowNum == 1)><tr></#if>
			<td>${fele.dispText}</td>
			<td colspan="3">
			<textarea id="${fn}" name="${fn}" cols="${fele.cols}" rows="${fele.rows}" editor="fckeditor2.3"></textarea>
				<script type="text/javascript">
				 var oFCKeditor = new FCKeditor('${fn}') ;
				 oFCKeditor.BasePath = 'FCKeditor/';
				 oFCKeditor.ToolbarSet = "Basic" ;
				 oFCKeditor.Height = ${fele.rows};
				 oFCKeditor.Width = ${fele.cols};
				 //oFCKeditor.ToolbarSet = "Gk" ; 
				 oFCKeditor.ReplaceTextarea();
				</script>
			</td>
			<#if ((posi % rowNum) == 0)></tr><tr></#if>
		</#if>
	<#else>
		<input type = "${fht}" name="${fn}" value="${fele.value?if_exists}" size="${fele.size?if_exists}" <#if fele.readonly??>'readonly=readonly'</#if>/>
	</#if>
	<#if notHidden && ((posi % rowNum) == 1)></tr></#if>
</#list>
</#macro>
<!-- FORM 数据输出 -->
<#macro output_fields_list fields>
<#list fields as feleO>
    <#assign fele=feleO.htmlWidget>
	<#assign fht=fele.htmlType>
	<#assign fn=feleO.field.fieldName>
	<#assign notHidden = (fht != "hidden")>
	<#if notHidden>
		<tr>
		<#if fht == "text" || fht == "password">
			<td>${fele.dispText}</td>
			<TD><input type = '${fht}' name="${fn}" size="${fele.size?if_exists}" <#if fele.readonly>readonly='readonly'</#if> limit="${fele.limits!''}" msg="${fele.comment!''}" msgSpan="msg_Span_${fele_index}" value="${fele.value?if_exists}"></TD>
			<td><span id="msg_Span_${fele_index}"></span></td>
		<#elseif fht == "select">
			<td>${fele.dispText}</td>
			<td><SELECT name="${fn}" <#if fele.onchange??>onchange = "${fele.onchange}"</#if>  limit="${fele.limits!''}" msg="${fele.comment ! ''}" <#if fele.readonly??>readonly='readonly'</#if>  msgSpan="msg_Span_${fele_index}">
				<option value="">未选择</option>
				<#list fele.dispList?keys as key>
					<option value="${key}">${fele.dispList[key]}</option>
				</#list>
			</SELECT></td><script language="javascript">eval("document.${window.formName}.${fn}.value = '${fele.value?if_exists}'");</script>
			<td><span id="msg_Span_${fele_index}"></span></td>
		<#elseif fht == "textarea">
			<td>${fele.dispText}</td><td><textarea name="${fn}" rows="${fele.rows?if_exists}" cols="${fele.cols?if_exists}" limit="${fele.limits!''}" msg="${fele.comment!''}"  msgSpan="msg_Span_${fele_index}">${fele.value?if_exists}</textarea></td>
			<td><span id="msg_Span_${fele_index}"></span></td>
		<#elseif fht == "fckeditor">
			<td align="left" colSpan="3">${fele.dispText}</td></tr>
			<tr><td colspan="3">
			<textarea id="${fn}" name="${fn}" cols="${fele.cols}" rows="${fele.rows}" editor="fckeditor2.3" msgSpan="msg_Span_${fele_index}">${fele.value?if_exists}</textarea>
				<script type="text/javascript">
				 var oFCKeditor = new FCKeditor('${fn}') ;
				 oFCKeditor.BasePath = 'FCKeditor/';
				 oFCKeditor.ToolbarSet = "Basic" ;
				 oFCKeditor.Height = ${fele.rows};
				 oFCKeditor.Width = ${fele.cols};
				 oFCKeditor.ReplaceTextarea();
				</script>
			</td></tr>
			<tr><td colspan="3"><span id="msg_Span_${fele_index}"></span></td>
		</#if>
		</tr>
	<#else>
		<input type = "${fht}" name="${fn}" value="${fele.value?if_exists}" size="${fele.size?if_exists}" <#if fele.readonly??>'readonly=readonly'</#if>/>
	</#if>
</#list>
</#macro>